import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
export const useUserStore = defineStore('user', () => {
  const user = ref(null)
  const isLoggedIn = computed(() => !!user.value)
  function setUser(newUser) {
    user.value = newUser
  }

  return { user, isLoggedIn, setUser }
})